//My
//sfjhdkjshfkdshfj
//dmk comment 2
//dmk comment
//hfjhdkshfks
<?php

/* (c) absokolov */

$uri = trim($_SERVER['REQUEST_URI'], '/');

$slashes = explode("/", $uri);

if (count($slashes) > 1) {
    unset($slashes[count($slashes)-1]);
    $new_uri = '/' . implode('/', $slashes) . '/';
} else {
    $new_uri = "/";
}

redirect($new_uri);

function redirect($url)
{
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: $url");

    exit;
}

?>
